<template>
  <div class="page-card handle-event">
    <a-button type="primary" @click="handleShow = true">进行处置</a-button>
    <br>
    <br>
    <div v-if="detail.link">
      <iframe :src="detail.link" frameborder="0"></iframe>
    </div>
    <a-empty v-else></a-empty>

    <a-divider></a-divider>
    <div class="sentiment-footer">
      <span class="primary">{{ detail.attention }}关注度</span>
      <span>文章来源：{{ detail.source }}</span>
    </div>
    <!-- 处置事件 -->
    <createEventHandle v-model="handleShow" :id="detail.id" :typeId="detail.typeId" />
  </div>
</template>

<script>
import SvgIcon from '@/components/SvgIcon';
import createEvent from '../home/action/createEvent';
import { sentimentDetail } from '@/api/serve';
// eslint-disable-next-line no-unused-vars
import { replaceHTML } from '@/api/common';
import moment from 'moment';
import createEventHandle from '../home/action/createEventHandle';

export default {
  components: {
    SvgIcon,
    createEvent,
    createEventHandle
  },
  inject: [],
  data() {
    return {
      moment,
      reload: false,
      handleShow: false,
      detail: {}
    };
  },
  created() {
    const id = this.$route.query.id;
    this.getDetail(id);
  },
  methods: {
    getDetail(id) {
      sentimentDetail({ id }).then(res => {
        this.detail = res.data;
      });
    }
  }
};
</script>

<style scoped lang="less">
  .sentiment-footer {
    margin-bottom: -24px;
    >span:first-child {
      color: #ff1a1a;
      margin-right: 30px;
    }
    >span:last-child {
      color: #999;
    }
  }
  iframe {
    width: 100%;
    height: 1200px;
  }
</style>
